home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD-ROM Advisor
/
CD-ROM Advisor.iso
/
prodemo
/
pdymain.dir
/
00001_Script_1
next >
Wrap
Text File
|
1995-09-29
|
5KB
|
148 lines
on startMovie
--it is important that this executes on returns from the opening movie and the animations
--after these returns, this resets the state of the menu
global gNumberOfMainButtons
global gCentersOfMainButtons, gMagicOffsetsOfMainButtons, gCastMemsOfMainButtons, gAniHasBeenViewed
global gRadiusOfMainButton
global gMagicH1, gMagicH2, gMagicV1, gMagicV2 --define regions for hit detection
global gAnisForMainButtons --names of Director movies (animations)
global gNumberOfSmallButtons
global gCentersOfSmallButtons, gMagicOffsetsOfSmallButtons, gCastMemsOfSmallButtons, gLabelsForSmallButtonActions
global gRadiusOfSmallButtons
global gIndexOfCurrentButton
global gMouseDownInButton --TRUE means down was in a button...in case of rollout
global gSmallButtonsOn --TRUE means that the small buttons are visible and active
global gIsMainButton, gIsSmallButton --makes gIndexOfCurr... relative to main or small button
global gChannelForHighLights, gChannelForFreeFlash
global gFreeFlashTimerBase
global gNextLabel
global gMovieToPlay
--$$$ start
global gCursorIsHand
put FALSE into gCursorIsHand
--$$$ end
put 4 into gChannelForHighLights
set the puppet of sprite gChannelForHighLights to TRUE
set the visible of sprite gChannelForHighLights to FALSE
put 3 into gChannelForFreeFlash
set the puppet of sprite gChannelForFreeFlash to TRUE
set the visible of sprite gChannelForFreeFlash to FALSE
put 0 into gIndexOfCurrentButton
put FALSE into gMouseDownInButton
put FALSE into gIsMainButton
put FALSE into gIsSmallButton
put FALSE into gMovieToPlay
-- in case this is the first frame after a return
-- from a movie, set cursor
cursor -1 -- pointer cursor
--startTimer
put the timer into gFreeFlashTimerBase
end startMovie
on isPositionWithinMainButton hPos, vPos
--if the position is within a main button, return its index
global gMagicH1, gMagicH2, gMagicV1, gMagicV2
put 0 into indexOfButton
--if it's in the right region do the distance test
if hPos < gMagicH1 then
-- might be Edna or Dylan
if vPos < gMagicV1 then
--might be Edna, ie index 2
if (isWithinThisMainButton(2, hPos, vPos)) then
put 2 into indexOfButton
end if
else
--might be Dylan, ie index 1
if(isWithinThisMainButton(1, hPos, vPos)) then
put 1 into indexOfButton
end if
end if
else
--might be Loni, Rol or WildB
if vPos < gMagicV1 then
--might be Loni or Roland
if hPos < gMagicH2 then
--might be Loni
if (isWithinThisMainButton(3, hPos, vPos))then
put 3 into indexOfButton
end if
else
if (isWithinThisMainButton(4, hPos, vPos))then
put 4 into indexOfButton
end if
end if
else
--might be WildB
if (isWithinThisMainButton(5, hPos, vPos))then
put 5 into indexOfButton
end if
end if
end if
return indexOfButton
end isPositionWithinMainButton
on isWithinThisMainButton index, h, v
global gCentersOfMainButtons
global gRadiusOfMainButton
put getAt(gCentersOfMainButtons, index) into centerTemp
put (getAt(centerTemp, 1) - h) into hComp
put (getAt(centerTemp, 2) - v) into vComp
put (sqrt((hComp * hComp) + (vComp * vComp)) < gRadiusOfMainButton) into r
return r
end isWithinThisMainButton
on isPositionWithinSmallButton hPos, vPos
--if the position is within a small button, return its index
global gMagicH1, gMagicH2, gMagicV1, gMagicV2
put 0 into indexOfButton
if vPos > gMagicV2 then
--might be exit or free buttons
if hPos < gMagicH1 then
--might be freetime button
if isWithinThisSmallButton(1, hPos, vPos) then
put 1 into indexOfButton
end if
else
if isWithinThisSmallButton (2, hPos, vPos) then
put 2 into indexOfButton
end if
end if
end if
return indexOfButton
end isPositionWithinSmallButton
on isWithinThisSmallButton index, h, v
global gCentersOfSmallButtons
global gRadiusOfSmallButtons
put getAt(gCentersOfSmallButtons, index) into centerTemp
put (getAt(centerTemp, 1) - h) into hComp
put (getAt(centerTemp, 2) - v) into vComp
put (sqrt((hComp * hComp) + (vComp * vComp)) < gRadiusOfSmallButtons) into r
return r
end isWithinThisSmallButton